# Maintainer: Jürgen Hötzel <juergen@archlinux.org>

pkgname=ocaml-integers
pkgver=0.4.0
pkgrel=4
pkgdesc='Library for binding to C libraries using pure OCaml'
arch=('i686' 'x86_64')
url=https://github.com/ocamllabs/ocaml-integers
license=('custom')
options=('!strip')
makedepends=('dune' 'ocaml-topkg' 'ocaml-findlib' 'ocaml-compiler-libs>=4.12.0' 'ocamlbuild' 'opam')
source=("$pkgname-$pkgver.tar.gz::https://github.com/ocamllabs/$pkgname/archive/$pkgver.tar.gz")
sha256sums=('ba6e087606c622533ecca9dc4c0917a3cc183e73e3e7d8511b68e21183ef913f')


build() {
  cd ${pkgname}-$pkgver
  dune build --profile release
}

package() {
  cd ${pkgname}-$pkgver

  opam-installer --prefix="${pkgdir}/usr" \
		 --libdir="${pkgdir}$(ocamlc -where)" \
		 --docdir="${pkgdir}/usr/share/doc" \
		 --stubsdir="${pkgdir}$(ocamlc -where)/stublibs" \
		 ./_build/default/integers.install
  install -Dm644 LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}"/LICENSE.md
}
